﻿using Cdhpy.Util;
using CdhpyScheduler.Core;
using CdhpyScheduler.WebHost.PubMethod;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace CdhpyScheduler.WebHost.Controllers
{
    public class IndexController : Controller
    {
        public static string CorpUserName = (ConfigurationManager.AppSettings["CorpUserName"]?.ToString() ?? string.Empty);
        
        public ActionResult Index()
        {
            ViewData["title"] = CorpUserName + "调度监控";
            return View();
        }

        public ActionResult Index2()
        {
            ViewData["title"] = CorpUserName + "调度监控";
            return View();
        }

        public ActionResult Manage()
        {
            ViewData["title"] = CorpUserName + "调度管理";
            return View();
        }

        public ActionResult Modify()
        {
            string jobKey = Request.QueryString["key"];
            ViewData["job"] = Job.jc.GetAllScheduledJobs()?.FirstOrDefault(aa => aa.jobKey_name == jobKey);
            return View();
        }

        public ActionResult Edit()
        {
            return View();
        }
    }
}